// i18n.js
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'

import en from './en'
import zh from './zh'
import ja from './ja'

const resources = {
  en: {
    translation: { ...en }
  },
  zh: {
    translation: { ...zh }
  },
  ja: {
    translation: { ...ja }
  }
}

i18n
  .use(initReactI18next) // passes i18n down to react-i18next
  .init({
    resources,
    fallbackLng: 'en',
    lng: 'en',
    interpolation: {
      escapeValue: false // not needed for React as it escapes by default
    }
  })

export default i18n